﻿<Window x:Class="FloydPink.Flickr.Downloadr.UI.LoginWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Welcome - flickr downloadr" ResizeMode="NoResize"
        WindowStartupLocation="CenterOwner" mc:Ignorable="d"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="317" d:DesignWidth="507"
        SizeToContent="WidthAndHeight"
        xmlns:controls="clr-namespace:FloydPink.Flickr.Downloadr.UI.Controls"
        xmlns:cachedImage="clr-namespace:CachedImage;assembly=CachedImage"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        Icon="/flickr%20downloadr;component/Images/icon.png">

    <Grid Height="287" Width="495">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="2*" />
                <RowDefinition Height="3*" />
                <RowDefinition Height="10" />
            </Grid.RowDefinitions>
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="80" />
                </Grid.ColumnDefinitions>
                <Image Grid.Column="1" Width="330" Source="/flickr%20downloadr;component/Images/logo-Small.png"
                       Stretch="Uniform" HorizontalAlignment="Right" VerticalAlignment="Center">
                    <Image.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Edit Log Configuration..." Click="EditLogConfigClick" />
                            <MenuItem Header="View Log..." Click="ViewLogClick" />
                        </ContextMenu>
                    </Image.ContextMenu>
                </Image>
                <StackPanel Grid.Column="2" VerticalAlignment="Top">
                    <Button Content="About" Width="60" Height="28" Margin="0, 10" Click="AboutButtonClick" />
                </StackPanel>
            </Grid>
            <Grid Grid.Row="1" Name="LoggedOutCanvas" Visibility="Collapsed">
                <Grid.RowDefinitions>
                    <RowDefinition Height="30" />
                    <RowDefinition Height="40" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Label Grid.Row="1" Content="Welcome to Flickr Downloadr. Click 'Login' to continue."
                       FontSize="16" HorizontalAlignment="Center" />
                <Button Grid.Row="2" Content="Login" Height="38" Width="141" FontSize="16" Click="LoginButtonClick" />
            </Grid>
            <Grid Grid.Row="1" Name="LoggedInCanvas" Visibility="Visible">
                <Grid.RowDefinitions>
                    <RowDefinition Height="60" />
                    <RowDefinition Height="40" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center"
                            VerticalAlignment="Center">
                    <cachedImage:Image Height="48" x:Name="BuddyIcon" Stretch="Fill" Width="48">
                        <Image.Effect>
                            <DropShadowEffect Color="Gray" BlurRadius="15" ShadowDepth="0" />
                        </Image.Effect>
                    </cachedImage:Image>
                    <Label Content="" FontSize="16" Name="WelcomeUserLabel" FontWeight="Bold"
                           FontStyle="Normal" FontFamily="Segoe UI" Margin="5,0,0,0" VerticalContentAlignment="Center" />
                </StackPanel>
                <Label Grid.Row="1" Content="Click 'Continue' to browse and download photos..."
                       Name="LoggedInLabel" FontSize="13" FontStretch="Normal" VerticalContentAlignment="Center"
                       HorizontalContentAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" />

                <Grid Grid.Row="2" VerticalAlignment="Bottom">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="2*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Column="0" Orientation="Horizontal">
                        <Button Content="Logout" FontSize="12" Height="28" Width="100" Click="LogoutButtonClick"
                                Margin="10,0" />
                        <Button Content="Preferences" FontSize="12" Height="28"
                                Name="PreferencesButton" Width="100" Click="PreferencesButtonClick" />
                    </StackPanel>
                    <Button Grid.Column="1" Content="Continue" Height="38" Name="ContinueButton"
                            Width="141" FontSize="16" Click="ContinueButtonClick" />
                </Grid>
            </Grid>
        </Grid>
        <AdornerDecorator Name="Spinner" Visibility="Collapsed">
            <controls:Spinner Cancellable="True" />
        </AdornerDecorator>
    </Grid>
</Window>